package com.cheng.cms.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

@Component
public class RedisUtil {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    //判断是否存在账户名
    public  boolean isUserExist(String name){
        String res = stringRedisTemplate.opsForValue().get(name);
        return res!=null;
    }

    //获取账户密码
    public  String getPassword(String name){
        return stringRedisTemplate.opsForValue().get(name);
    }
}
